};
gboolean
-ostree_builtin_admin (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_admin (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
gboolean ret = FALSE;
- __attribute__((unused)) GCancellable *cancellable = NULL;
const char *opt_sysroot = "/";
const char *subcommand_name;
OstreeAdminCommand *subcommand;
}
gboolean
-ostree_builtin_cat (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_cat (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
GOptionContext *context;
gboolean ret = FALSE;
int i;
- GCancellable *cancellable = NULL;
const char *rev;
gs_unref_object OstreeRepo *repo = NULL;
gs_unref_object GOutputStream *stdout_stream = NULL;
}
gboolean
-ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
GOptionContext *context;
- GCancellable *cancellable = NULL;
gboolean ret = FALSE;
const char *commit;
const char *destination;
}
gboolean
-ostree_builtin_checksum (int argc, char **argv, GFile *repo_path_path, GError **error)
+ostree_builtin_checksum (int argc, char **argv, GFile *repo_path_path, GCancellable *cancellable, GError **error)
{
GOptionContext *context;
gboolean ret = FALSE;
data.loop = g_main_loop_new (NULL, FALSE);
data.error = error;
- ostree_checksum_file_async (f, OSTREE_OBJECT_TYPE_FILE, G_PRIORITY_DEFAULT, NULL, on_checksum_received, &data);
+ ostree_checksum_file_async (f, OSTREE_OBJECT_TYPE_FILE, G_PRIORITY_DEFAULT, cancellable, on_checksum_received, &data);
g_main_loop_run (data.loop);
}
gboolean
-ostree_builtin_commit (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_commit (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
GOptionContext *context;
gboolean ret = FALSE;
gboolean skip_commit = FALSE;
gboolean in_transaction = FALSE;
- GCancellable *cancellable = NULL;
gs_unref_object OstreeRepo *repo = NULL;
gs_unref_object GFile *arg = NULL;
gs_free char *parent = NULL;
}
gboolean
-ostree_builtin_config (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_config (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
GOptionContext *context = NULL;
gboolean ret = FALSE;
}
gboolean
-ostree_builtin_diff (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_diff (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
gboolean ret = FALSE;
GOptionContext *context;
- GCancellable *cancellable = NULL;
const char *src;
const char *target;
gs_unref_object OstreeRepo *repo = NULL;
}
gboolean
-ostree_builtin_fsck (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_fsck (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
+ gboolean ret = FALSE;
GOptionContext *context;
OtFsckData data;
- gboolean ret = FALSE;
- GCancellable *cancellable = NULL;
GHashTableIter hash_iter;
gpointer key, value;
gs_unref_object OstreeRepo *repo = NULL;
gboolean
-ostree_builtin_init (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_init (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
GOptionContext *context = NULL;
gboolean ret = FALSE;
- __attribute__ ((unused)) GCancellable *cancellable = NULL;
const char *mode_str = "bare";
gs_unref_object GFile *child = NULL;
gs_unref_object GFile *grandchild = NULL;
};
gboolean
-ostree_builtin_log (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_log (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
GOptionContext *context;
gboolean ret = FALSE;
}
gboolean
-ostree_builtin_ls (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_ls (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
GOptionContext *context;
gboolean ret = FALSE;
}
rev = argv[1];
- if (!ostree_repo_read_commit (repo, rev, &root, NULL, error))
+ if (!ostree_repo_read_commit (repo, rev, &root, cancellable, error))
goto out;
for (i = 2; i < argc; i++)
g_clear_object (&file_info);
file_info = g_file_query_info (f, OSTREE_GIO_FAST_QUERYINFO,
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
- NULL, error);
+ cancellable, error);
if (!file_info)
goto out;
};
gboolean
-ostree_builtin_prune (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_prune (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
gboolean ret = FALSE;
GOptionContext *context;
- GCancellable *cancellable = NULL;
gs_unref_object OstreeRepo *repo = NULL;
gs_free char *formatted_freed_size = NULL;
OstreeRepoPruneFlags pruneflags = 0;
}
gboolean
-ostree_builtin_pull_local (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_pull_local (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
gboolean ret = FALSE;
- GCancellable *cancellable = NULL;
GOptionContext *context;
const char *src_repo_path;
int i;
};
gboolean
-ostree_builtin_pull (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_pull (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
GOptionContext *context;
gboolean ret = FALSE;
- GCancellable *cancellable = NULL;
const char *remote;
OstreeRepoPullFlags pullflags = 0;
gs_unref_object OstreeRepo *repo = NULL;
};
gboolean
-ostree_builtin_refs (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_refs (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
gboolean ret = FALSE;
- GCancellable *cancellable = NULL;
GOptionContext *context;
const char *refspec_prefix = NULL;
gs_unref_object OstreeRepo *repo = NULL;
}
gboolean
-ostree_builtin_remote (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_remote (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
GOptionContext *context;
gboolean ret = FALSE;
};
gboolean
-ostree_builtin_rev_parse (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_rev_parse (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
GOptionContext *context;
gboolean ret = FALSE;
}
gboolean
-ostree_builtin_show (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_show (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
GOptionContext *context;
gboolean ret = FALSE;
}
gboolean
-ostree_builtin_trivial_httpd (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_trivial_httpd (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
gboolean ret = FALSE;
- GCancellable *cancellable = NULL;
GOptionContext *context;
const char *dirpath;
OtTrivialHttpd appstruct;
};
gboolean
-ostree_builtin_write_refs (int argc, char **argv, GFile *repo_path, GError **error)
+ostree_builtin_write_refs (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error)
{
GOptionContext *context;
gboolean ret = FALSE;
- GCancellable *cancellable = NULL;
GError *temp_error = NULL;
gsize len;
gs_unref_object OstreeRepo *repo = NULL;
G_BEGIN_DECLS
-gboolean ostree_builtin_admin (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_cat (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_config (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_checksum (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_commit (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_diff (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_init (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_pull (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_pull_local (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_log (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_ls (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_prune (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_refs (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_fsck (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_show (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_rev_parse (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_remote (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_write_refs (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_trivial_httpd (int argc, char **argv, GFile *repo_path, GError **error);
+gboolean ostree_builtin_admin (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_cat (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_config (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_checksum (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_commit (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_diff (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_init (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_pull (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_pull_local (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_log (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_ls (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_prune (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_refs (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_fsck (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_show (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_rev_parse (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_remote (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_write_refs (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
+gboolean ostree_builtin_trivial_httpd (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
G_END_DECLS
{
OstreeCommand *command;
GError *error = NULL;
+ GCancellable *cancellable = NULL;
int cmd_argc;
char **cmd_argv = NULL;
gboolean have_repo_arg;
ostree_prep_builtin_argv (cmd, argc-arg_off, argv+arg_off, &cmd_argc, &cmd_argv);
- if (!command->fn (cmd_argc, cmd_argv, repo_file, &error))
+ if (!command->fn (cmd_argc, cmd_argv, repo_file, cancellable, &error))
goto out;
out:
typedef struct {
const char *name;
- gboolean (*fn) (int argc, char **argv, GFile *repo_path, GError **error);
+ gboolean (*fn) (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error);
int flags; /* OstreeBuiltinFlags */
} OstreeCommand;